package com.fh.lib_base.data.api

import com.fh.lib_base.base.BaseBean
import com.fh.lib_base.data.bean.*
import io.reactivex.Observable
import retrofit2.http.*

/**
 * @author Alwyn
 * @Date 2020/7/22
 * @Description
 */
interface ApiService {

    /**
     * 登录
     */
    @POST("user/login")
    @FormUrlEncoded
    fun pwdLogin(
        @Field("username") username: String,
        @Field("password") password: String
    ): Observable<BaseBean<UserBean>>

    //获取搜索页面轮播图数据
    @GET("/hotel-api/api/index/rotationChart")
    fun getSearchBannerData(): Observable<BaseBean<List<BannerBean>>>

    //获取热门城市列表
    @GET("/hotel-api/api/index/popularCityList")
    fun getHotCityListData(): Observable<BaseBean<ArrayList<CityBean>>>

    //获取所有城市列表
    @GET("/hotel-api/api/index/cityList")
    fun getAllCityListData(): Observable<BaseBean<ArrayList<CitySortBean>>>

    //获取城市搜索结果
    @GET("/hotel-api/api/index/queryCityList")
    fun getCitySearchResultListData(@Query("name") name: String): Observable<BaseBean<ArrayList<CityBean>>>
}